# @Time    :2025/4/1 10:50

class Birds:

    def __init__(self, name, color, skill_description):
        self.name = name
        self.color = color
        self.skill_description = skill_description

    def fly(self):
        print(f"{self.name}以什么样的方式飞翔.....")

    def call(self):
        print(f"{self.name}发出什么什么样的的叫声.....")

    def use_skill(self):
        print(f"{self.name}使用了{self.skill_description}的技能.....")


class RedBirds(Birds):
    def __init__(self):
        super().__init__("红火", "红色的", "撞击前方障碍物，造成了大量伤害")

    def fly(self):
        print(f"{self.name}以稳定的方式飞翔.....")

    def call(self):
        print(f"{self.name}发出嘎嘎的的叫声.....")


class YellowBirds(Birds):
    def __init__(self):
        super().__init__("黄黄", "黄色的", "瞬间加速，穿透薄障碍物")

    def fly(self):
        print(f"{self.name}以优雅的方式飞翔.....")

    def call(self):
        print(f"{self.name}发出吱吱的的叫声.....")


class BlueBirds(Birds):
    def __init__(self):
        super().__init__("蓝冰", "蓝色的", "华丽变身，分裂成三只小鸟，分散攻击")

    def fly(self):
        print(f"{self.name}快速的向前飞翔.....")

    def call(self):
        print(f"{self.name}发出呀呀的的叫声.....")


# 定义障碍物类

class Obstacle:
    def __init__(self, name, strength):
        self.name = name
        self.strength = strength

    # 攻击堡垒
    def be_attacked(self, bird):
        print(f"{bird.name}冲向了{self.name}")
        bird.use_skill()
        if isinstance(bird, RedBirds):
            damage = 80
        elif isinstance(bird, YellowBirds):
            damage = 50
        elif isinstance(bird, BlueBirds):
            damage = 30 * 3
        self.strength -= damage

        if self.strength <= 0:
            print(f"{self.name}被摧毁了")
        else:
            print(f"还剩下{self.strength}点坚固值")


# 创建障碍物
ob1 = Obstacle("木头堡垒", 100)
ob2 = Obstacle("石头塔楼", 200)

# 实例化鸟
red = RedBirds()
blu = BlueBirds()
yel = YellowBirds()

ob1.be_attacked(red)
ob2.be_attacked(blu)
ob2.be_attacked(yel)
